/**
 * Created by Administrator on 2016/9/17.
 */
$(function(){
    var startX=0;
    var moveX=0;
    var distanceX=0;
    var delayX=30;
    $(".carousel").on("touchstart",function(e){
     startX= e.originalEvent.touches[0].clientX;
    })
    $(".carousel").on("touchmove",function(e){
       distanceX= e.originalEvent.touches[0].clientX-startX;

    })
    $(".carousel").on("touchend",function(e){
        if(Math.abs(distanceX)>delayX){
            if(distanceX>0){
                $(this).carousel('prev');
            }else{
                $(this).carousel('next');

            }
        }

    })
})